package com.example.activemq.config;

import org.apache.activemq.ActiveMQSession;
import org.apache.activemq.command.ActiveMQQueue;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.jms.config.JmsListenerContainerFactory;
import org.springframework.jms.config.SimpleJmsListenerContainerFactory;
import org.springframework.stereotype.Component;

import javax.jms.ConnectionFactory;
import javax.jms.Queue;


/**
 * @author LiYuhang
 * @version 0.1
 * @application
 * @Date 2021/4/2 22:49
 * @Description TODO
 */
@Component
public class QueueConfig {

    @Value("${spring.activemq.queue-name}")
    private String queueName;

    @Bean
    Queue queue(){
        return  new ActiveMQQueue(queueName);
    }

    @Bean(name = "queueTest")
    public Queue queueTest() {
        return new ActiveMQQueue("queue-test");
    }

    @Bean(name = "delayQueue")
    public Queue delayQueue() {
        return new ActiveMQQueue("delay-queue-test");
    }






}
